|
|
|
|
|
|
|
1. What are the three levels of locking provided by the Microsoft Jet database engine? |
|
|
|
|
|
|
|
|
2. Which form of locking would you use when compacting a database? |
|
|
|
|
|
|
|
|
3. Which form of locking would you use if you needed to update price codes in the price table of a database? |
|
|
|
|
|
|
|
|
4. Which property of a Recordset do you set to control whether your application's data has optimistic or pessimistic page locking? |
|
|
|
|
|
|
|
|
5. What is the difference between pessimistic and optimistic page locking? |
|
|
|
|
|
|
|
|
6. Can you use pessimistic locking on an ODBC data source? |
|
|
|
|
|
|
|
|
7. What happens to data when cascading deletes are used in a relationship? |
|
|
|
|
|
|
|
|
8. Why would you use transaction management in your applications? |
|
|
|
|
|
|
|
|
9. What are the limitations of transactions? |
|
|
|
|
|
|
|
|
10. Do you need to declare a workspace when using transactions? |
|
|
|
|
|
|
|
|
1. Write Visual Basic code that exclusively opens a database (C:\DATA\ABC.MDB) during a Form Load event. Include error trapping. |
|
|
|
|
|
|
|
|
2. Build on the code you wrote in the previous exercise to exclusively open the table Customers in ABC.MDB. |
|
|
|
|
|
|
|
|
3. Suppose that you are building a new accounts receivable system for your company. You have saved all tables and data into a single database named C:\DATA\ABC.MDB. You have discovered that all invoices created must be posted to a history file on a daily basis. Because this history file is extremely valuable (it is used for collections, reporting, and so on), you don't want your posting process to destroy any of the data that it currently contains. Therefore, you decide to use transactions in your code. |
|
|
|
|
|
|
|
|
Write the Visual Basic code that takes invoice transactions from the temporary holding table, Transactions, and inserts them into a table named History, which keeps the cumulative history information. |
|
|
|
|
|
|
|
|
The History table contains four fields: HistoryItem (counter and primary key), CustID (a unique identifier for the customer), InvoiceNo (the number of the invoice issued to the customer), and Amount. |
|
|
|
|
|
|
|
|
The Transactions table also has four fields: TransNo (counter and primary key), CustID (a unique identifier for the customer), InvoiceNo (the number of the invoice issued to the customer), and Amount. |
|
|
|
|
|